Conversation
| @@ -0,0 +1,44 @@ | |||
| #include "quick_sort.hpp" | |||
|
|
|||
| std::vector<double> Smaller(double elem, std::vector<double> input) { | |||
There was a problem hiding this comment.
warning: the parameter 'input' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
| std::vector<double> Smaller(double elem, std::vector<double> input) { | |
| std::vector<double> Smaller(double elem, const std::vector<double>&const e elem, std::vector&<double> input) { |
| return smaller; | ||
| } | ||
|
|
||
| std::vector<double> Bigger(double elem, std::vector<double> input) { |
There was a problem hiding this comment.
warning: the parameter 'input' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
| std::vector<double> Bigger(double elem, std::vector<double> input) { | |
| std::vector<double> Bigger(double elem, const std::vector<double>& input) { |
task_05/src/quick_sort.hpp:4:
- std::vector<double> Bigger(double elem, std::vector<double> input);
+ std::vector<double> Bigger(double elem, const std::vector<double>& input);| return bigger; | ||
| } | ||
|
|
||
| std::vector<double> Eq(double elem, std::vector<double> input) { |
There was a problem hiding this comment.
warning: the parameter 'input' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
| std::vector<double> Eq(double elem, std::vector<double> input) { | |
| std::vector<double> Eq(double elem, const std::vector<double>& input) { |
task_05/src/quick_sort.hpp:6:
- std::vector<double> Eq(double elem, std::vector<double> input);
+ std::vector<double> Eq(double elem, const std::vector<double>& input);| Node* right_child = nullptr; | ||
| int height = 1; | ||
| Node(int key, int data) { | ||
| this->key = key; |
There was a problem hiding this comment.
warning: 'key' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
task_07/src/avl_tree.hpp:27:
- Node(int key, int data) {
- this->key = key;
+ Node(int key, int data) : key(key) {
+ | int height = 1; | ||
| Node(int key, int data) { | ||
| this->key = key; | ||
| this->data = data; |
There was a problem hiding this comment.
warning: 'data' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
task_07/src/avl_tree.hpp:27:
- Node(int key, int data) {
+ Node(int key, int data), data(data) {| this->data = data; | |
| @@ -1 +1,31 @@ | |||
| #include "util.hpp" | |||
|
|
|||
| std::vector<double> Smaller(double elem, std::vector<double> input) { | |||
There was a problem hiding this comment.
warning: the parameter 'input' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
| std::vector<double> Smaller(double elem, std::vector<double> input) { | |
| std::vector<double> Smaller(double elem, const std::vector<double>&const d::vector<double> i&nput); |
| return smaller; | ||
| } | ||
|
|
||
| std::vector<double> Bigger(double elem, std::vector<double> input) { |
There was a problem hiding this comment.
warning: the parameter 'input' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
lib/src/util.hpp:4:
- std::vector<double> Bigger(double elem, std::vector<double> input);
+ std::vector<double> Bigger(double elem, const std::vector<double>& input);| std::vector<double> Bigger(double elem, std::vector<double> input) { | |
| std::vector<double> Bigger(double elem, const std::vector<double>& input) { |
| return bigger; | ||
| } | ||
|
|
||
| std::vector<double> Eq(double elem, std::vector<double> input) { |
There was a problem hiding this comment.
warning: the parameter 'input' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
lib/src/util.hpp:6:
- std::vector<double> Eq(double elem, std::vector<double> input);
+ std::vector<double> Eq(double elem, const std::vector<double>& input);| std::vector<double> Eq(double elem, std::vector<double> input) { | |
| std::vector<double> Eq(double elem, const std::vector<double>& input) { |
|
|
||
| template <typename T> | ||
| requires(std::totally_ordered<T>) | ||
| T MinStack<T>::GetMin() { |
There was a problem hiding this comment.
давай сделаем метод константным)
| #include <stack> | ||
| #include <vector> | ||
|
|
||
| struct TemperatureWithDayIndex { |
There was a problem hiding this comment.
давай структурку внутрь cpp переместим, это реализация её лучше не светить
| }; | ||
|
|
||
| template <typename T> | ||
| requires(std::totally_ordered<T>) |
There was a problem hiding this comment.
warning: 'T' does not refer to a value [clang-diagnostic-error]
requires(std::totally_ordered<T>)
^Additional context
task_02/src/stack.hpp:33: declared here
template <typename T>
^| }; | ||
|
|
||
| template <typename T> | ||
| requires(std::totally_ordered<T>) |
There was a problem hiding this comment.
warning: a type specifier is required for all declarations [clang-diagnostic-error]
requires(std::totally_ordered<T>)
^| }; | ||
|
|
||
| template <typename T> | ||
| requires(std::totally_ordered<T>) |
There was a problem hiding this comment.
warning: expected ';' after top level declarator [clang-diagnostic-error]
| requires(std::totally_ordered<T>) | |
| requires(std::totally_ordered<T>); |
| }; | ||
|
|
||
| template <typename T> | ||
| requires(std::totally_ordered<T>) |
There was a problem hiding this comment.
warning: expected expression [clang-diagnostic-error]
requires(std::totally_ordered<T>)
^| }; | ||
|
|
||
| template <typename T> | ||
| requires(std::totally_ordered<T>) |
There was a problem hiding this comment.
warning: no member named 'totally_ordered' in namespace 'std' [clang-diagnostic-error]
requires(std::totally_ordered<T>)
^|
|
||
| private: | ||
| std::vector<int> data_; | ||
| Node<T>* head = nullptr; |
There was a problem hiding this comment.
warning: use of undeclared identifier 'T' [clang-diagnostic-error]
Node<T>* head = nullptr;
^| private: | ||
| std::vector<int> data_; | ||
| Node<T>* head = nullptr; | ||
| Node<T>* head_min = nullptr; |
There was a problem hiding this comment.
warning: use of undeclared identifier 'T' [clang-diagnostic-error]
Node<T>* head_min = nullptr;
^| } | ||
|
|
||
| template <typename T> | ||
| requires(std::totally_ordered<T>) |
There was a problem hiding this comment.
warning: 'T' does not refer to a value [clang-diagnostic-error]
requires(std::totally_ordered<T>)
^Additional context
task_02/src/stack.hpp:84: declared here
template <typename T>
^| } | ||
|
|
||
| template <typename T> | ||
| requires(std::totally_ordered<T>) |
There was a problem hiding this comment.
warning: a type specifier is required for all declarations [clang-diagnostic-error]
requires(std::totally_ordered<T>)
^| } | ||
|
|
||
| template <typename T> | ||
| requires(std::totally_ordered<T>) |
There was a problem hiding this comment.
warning: expected ';' after top level declarator [clang-diagnostic-error]
| requires(std::totally_ordered<T>) | |
| requires(std::totally_ordered<T>); |
|
|
||
| public: | ||
| friend std::ostream& operator<<(std::ostream& os, const AvlTree& tree); | ||
| class Iterator { |
There was a problem hiding this comment.
добавь тестов для итератора
| @@ -0,0 +1,93 @@ | |||
| #include "hash_table.hpp" | |||
|
|
|||
| int HashTable::SecondHashFunc(std::string key) { return 1; } | |||
| array[index].value = new_value; | ||
| array[index].condition = Condition::Full; | ||
| full_elements += 1; | ||
| if (full_elements > array.size() / 2) { |
There was a problem hiding this comment.
давай в начале функции проверим, код будет проще
| } | ||
|
|
||
| template <typename T> | ||
| requires(std::totally_ordered<T>) |
There was a problem hiding this comment.
warning: expected expression [clang-diagnostic-error]
requires(std::totally_ordered<T>)
^| } | ||
|
|
||
| template <typename T> | ||
| requires(std::totally_ordered<T>) |
There was a problem hiding this comment.
warning: no member named 'totally_ordered' in namespace 'std' [clang-diagnostic-error]
requires(std::totally_ordered<T>)
^|
|
||
| template <typename T> | ||
| requires(std::totally_ordered<T>) | ||
| void MinStack<T>::Push(T value) { |
There was a problem hiding this comment.
warning: expected ';' after top level declarator [clang-diagnostic-error]
| void MinStack<T>::Push(T value) { | |
| void MinStack;<T>::Push(T value) { |
|
|
||
| template <typename T> | ||
| requires(std::totally_ordered<T>) | ||
| void MinStack<T>::Push(T value) { |
There was a problem hiding this comment.
warning: variable has incomplete type 'void' [clang-diagnostic-error]
void MinStack<T>::Push(T value) {
^| } | ||
|
|
||
| AvlTree::Node* AvlTree::LeftRightImbalance(Node* old_par) { | ||
| Node* new_par = RightRightImbalance(old_par->left_child); |
There was a problem hiding this comment.
warning: Value stored to 'new_par' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
ance(Node* old_par) {
^Additional context
task_07/src/avl_tree.cpp:198: Value stored to 'new_par' during its initialization is never read
ance(Node* old_par) {
^| } | ||
|
|
||
| AvlTree::Node* AvlTree::RightLeftImbalance(Node* old_par) { | ||
| Node* new_par = LeftLeftImbalance(old_par->right_child); |
There was a problem hiding this comment.
warning: Value stored to 'new_par' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
ance(Node* old_par) {
^Additional context
task_07/src/avl_tree.cpp:204: Value stored to 'new_par' during its initialization is never read
ance(Node* old_par) {
^|
|
||
| private: | ||
| Node* current_node; | ||
| const AvlTree& tree; |
There was a problem hiding this comment.
warning: member 'tree' of type 'const AvlTree &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members]
const AvlTree& tree;
^| @@ -0,0 +1,95 @@ | |||
| #include "hash_table.hpp" | |||
|
|
|||
| int HashTable::SecondHashFunc(const std::string& key) { return 1; } | |||
There was a problem hiding this comment.
warning: parameter 'key' is unused [misc-unused-parameters]
| int HashTable::SecondHashFunc(const std::string& key) { return 1; } | |
| int HashTable::SecondHashFunc(const std::string& /*key*/) { return 1; } |
| array = vec; | ||
| } | ||
|
|
||
| HashTable::HashTable(std::vector<std::pair<std::string, int>> input) { |
There was a problem hiding this comment.
warning: the parameter 'input' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
task_08/src/hash_table.hpp:14:
- HashTable(std::vector<std::pair<std::string, int>> input);
+ HashTable(const std::vector<std::pair<std::string, int>>& input);| HashTable::HashTable(std::vector<std::pair<std::string, int>> input) { | |
| HashTable::HashTable(const std::vector<std::pair<std::string, int>>& input) { |
| HashTable::HashTable(std::vector<std::pair<std::string, int>> input) { | ||
| std::vector<Element> vec(input.size() * 3); | ||
| array = vec; | ||
| for (auto elem : input) { |
There was a problem hiding this comment.
warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
| for (auto elem : input) { | |
| for (const auto& elem : input) { |
| } | ||
| bool is_found{false}; | ||
| for (int j{0}; j < matrix[0].size(); ++j) { | ||
| if (prefikses_from_bools[r][j] - prefikses_from_bools[l][j] == |
| } | ||
| void Push(T value); | ||
| T Pop(); | ||
| T const GetMin(); |
There was a problem hiding this comment.
warning: unknown type name 'T' [clang-diagnostic-error]
T const GetMin();
^| array = vec; | ||
| } | ||
|
|
||
| HashTable::HashTable(const std::vector<std::pair<std::string, int>> input) { |
There was a problem hiding this comment.
warning: the const qualified parameter 'input' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
task_08/src/hash_table.hpp:14:
- HashTable(const std::vector<std::pair<std::string, int>> input);
+ HashTable(const std::vector<std::pair<std::string, int>>& input);| HashTable::HashTable(const std::vector<std::pair<std::string, int>> input) { | |
| HashTable::HashTable(const std::vector<std::pair<std::string, int>>& input) { |
| HashTable::HashTable(const std::vector<std::pair<std::string, int>> input) { | ||
| std::vector<Element> vec(input.size() * 3); | ||
| array = vec; | ||
| for (const auto elem : input) { |
There was a problem hiding this comment.
warning: the loop variable's type is not a reference type; this creates a copy in each iteration; consider making this a reference [performance-for-range-copy]
| for (const auto elem : input) { | |
| for (const auto& elem : input) { |
| #include <algorithm> | ||
| #include <vector> | ||
|
|
||
| void QuickSortInplace(std::vector<double>& arr, int left, int right) { |
There was a problem hiding this comment.
warning: function 'QuickSortInplace' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
| void QuickSortInplace(std::vector<double>& arr, int left, int right) { | |
| static void QuickSortInplace(std::vector<double>& arr, int left, int right) { |
| #include <algorithm> | ||
| #include <vector> | ||
|
|
||
| static void QuickSortInplace(std::vector<double>& arr, int left, int right) { |
There was a problem hiding this comment.
warning: function 'QuickSortInplace' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
static void QuickSortInplace(std::vector<double>& arr, int left, int right) {
^| @@ -0,0 +1,3 @@ | |||
| #include <vector> | |||
| std::vector<int> calculate_fish_days(int N, int K, | |||
No description provided.